﻿using SportTraining.Core.Domain;

namespace SportTraining.MVVM.ViewModel.Impl
{
    public class SectionItemViewModel : ViewModelBase<SectionItemViewModel>,ISectionItemViewModel
    {
        private readonly PriceItemViewModel priceItem;
        public ISection Section { get; private set; }

        public SectionItemViewModel(ISection section)
        {
            Section = section;

            priceItem = new PriceItemViewModel(section.ActualPrice);
        }

        public override string ToString()
        {
            return Section.ToString();
        }

        private bool isSelected;
        public bool IsSelected
        {
            get { return isSelected; }
            set
            {
                isSelected = value;
                FirePropertyChanged(type => type.IsSelected);
            }
        }

        
        public PriceItemViewModel ActualPrice
        {
            get { return priceItem; }
        }
    }
}